"""
@filename=demo1.py
@version=0.1.0.20230430
@author=amnotgcs
@createTime=20230430 21:12
@lastModifiedTime=20230430 21:37
@description=多线程
"""


from threading import Thread
from time import sleep


class CookBook(Thread):
    
    def print_message(self):
        print(self.getName())
    
    def run(self):
        for _ in range(5):
            self.print_message()
            sleep(2)


if __name__ == '__main__':
    print('Process started')
    cookBook= CookBook()
    cookBook.start()
    print('Process ended')
